#pragma once
#include <mutex>

template <class T>
class Singleton
{
public:
    static T &GetInstance()
    {
        static T instance; // magic static，确保线程安全并初始化
        return instance;
    }
private:
    Singleton() = default;
    Singleton(const Singleton &) = delete;
    Singleton &operator=(const Singleton &) = delete;
    ~Singleton() = default;
};

